package cn.com.dcsgo.controller;

import cn.com.dcsgo.service.StudentService;
import org.springframework.stereotype.Controller;

/**
 * StudentController
 *
 * @author Dcsgo
 * @since 2025/2/4 11:25
 */
@Controller
public class StudentController {
    private final StudentService studentService;

    /**
     * 从 Spring 4.3 开始，只有一个构造器时可以省略@Autowried注解
     * @param studentService studentService
     */
    public StudentController(StudentService studentService) {
        this.studentService = studentService;
    }

    public void studentsInfo() {
        studentService.findAll().forEach(System.out::println);
    }
}
